package com.aierjun.lgmusic.utils;

import android.util.Log;

import org.xml.sax.Parser;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by Administrator on 2016/10/11.
 */
public class TimeUtil {
    private static TimeUtil self;
    public  static synchronized TimeUtil getInstance(){
        if (self==null) self=new TimeUtil();
        return self;
    }
    public Long getTime(Long time){
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
        Date d1=new Date(time);
        String t1=simpleDateFormat.format(d1);
        Long date=Long.parseLong(t1);
        Log.e("msg", t1);
        return date;
    }
    public Long getTime(){
        long time=System.currentTimeMillis();//long now = android.os.SystemClock.uptimeMillis();
        SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date d1=new Date(time);
        String t1=format.format(d1);
        Long date=Long.parseLong(t1);
        Log.e("msg", t1);
        return date;
    }
}
